/**
 * Author atguigu
 * Date 2020/11/16 16:11
 */
object FlatMap {
    def main(args: Array[String]): Unit = {
        val list1 = List(30, 50, 70, 60, 10, 20)
        
        val list2 = map(list1, x => x * x *3 * x * x)
        println(list2)
    }
    
    
    def map(arr: List[Int], op: Int => Int) = {
        for (elem <- arr) yield op(elem)
    }
    
}
